home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-PPC / PROM.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  81 lines

  1. /*
  2.  * Definitions for talking to the Open Firmware PROM on
  3.  * Power Macintosh computers.
  4.  *
  5.  * Copyright (C) 1996 Paul Mackerras.
  6.  */
  7.  
  8. typedef void *phandle;
  9. typedef void *ihandle;
  10.  
  11. extern char *prom_display_paths[];
  12. extern unsigned int prom_num_displays;
  13.  
  14. struct address_range {
  15.     unsigned int space;
  16.     unsigned int address;
  17.     unsigned int size;
  18. };
  19.  
  20. struct interrupt_info {
  21.     int    line;
  22.     int    sense;        /* +ve/-ve logic, edge or level, etc. */
  23. };
  24.  
  25. struct reg_property {
  26.     unsigned int address;
  27.     unsigned int size;
  28. };
  29.  
  30. struct translation_property {
  31.     unsigned int virt;
  32.     unsigned int size;
  33.     unsigned int phys;
  34.     unsigned int flags;
  35. };
  36.  
  37. struct property {
  38.     char    *name;
  39.     int    length;
  40.     unsigned char *value;
  41.     struct property *next;
  42. };
  43.  
  44. struct device_node {
  45.     char    *name;
  46.     char    *type;
  47.     phandle    node;
  48.     int    n_addrs;
  49.     struct    address_range *addrs;
  50.     int    n_intrs;
  51.     struct    interrupt_info *intrs;
  52.     char    *full_name;
  53.     struct    property *properties;
  54.     struct    device_node *parent;
  55.     struct    device_node *child;
  56.     struct    device_node *sibling;
  57.     struct    device_node *next;    /* next device of same type */
  58.     struct    device_node *allnext;    /* next in list of all nodes */
  59. };
  60.  
  61. struct prom_args;
  62. typedef void (*prom_entry)(struct prom_args *);
  63.  
  64. /* Prototypes */
  65. extern void abort(void);
  66. extern void prom_init(int, int, prom_entry);
  67. extern void prom_print(const char *msg);
  68. extern void finish_device_tree(void);
  69. extern struct device_node *find_devices(const char *name);
  70. extern struct device_node *find_type_devices(const char *type);
  71. extern struct device_node *find_path_device(const char *path);
  72. extern struct device_node *find_compatible_devices(const char *type,
  73.                            const char *compat);
  74. extern struct device_node *find_phandle(phandle);
  75. extern int device_is_compatible(struct device_node *device, const char* compat);
  76. extern unsigned char *get_property(struct device_node *node, const char *name,
  77.                    int *lenp);
  78. extern void print_properties(struct device_node *node);
  79. extern int call_rtas(const char *service, int nargs, int nret,
  80.              unsigned long *outputs, ...);
  81.